<?php
define('IN_ADMINCP', TRUE);
define('ADMINCP_AJAX', AJAX);
define('ADMINCP_PATH', dirname(__FILE__));
define('APP_PATH', dirname(ADMINCP_PATH));
require APP_PATH . '/app.php';

$action = $_G['gp_action'] ? $_G['gp_action'] : 'cpindex';
$operation = $_G['gp_operation'] ? $_G['gp_operation'] : 'index';

$admincp = new admincp;
$use_link = '../';

if ( $admincp->allow($action, $operation) ){
	$actlink = "?action={$action}&operation={$operation}";
	if ( AJAX && $ajax = $admincp->ajaxfile($action, $operation) ){
		(include $ajax);
	}
	include $admincp->cpfile($action, $operation, $ajax);
	if ( AJAX && $ajax = $admincp->cpajax($action, $operation) ){
		!defined('AJAX_TEMPLATE') or define('NOTEMPLATE', TRUE);
		include $ajax;
	}

	if ( !defined('AUTOLOAD_TEMPLATE') && !isset($autoload_template) && !defined('NOTEMPLATE') ){
		$template = $autoload_template ? $autoload_template : "admin_{$_G['admincp']['action']}_{$_G['admincp']['operation']}";
		$template .= $tmpname;
		include template($template);
	}
}else{
	$admincp->noallow();
}


